package logger

const (
	C_Blue      = 1
	C_BlueLight = 11
	C_White     = 0
	C_Yellow    = 14
	C_Red       = 4
	C_Pink      = 14
	C_Grey      = 15
	C_Purple    = 5
)

func InitLogger() {
	//
	//logConf := make(map[string]interface{})
	//maxlines, lerr := web.AppConfig.Int("Log::MaxLines")
	//if lerr != nil {
	//	maxlines = 1000
	//}
	//logConf["maxlines"] = maxlines
	//
	//logConf["filename"] = web.AppConfig.DefaultString("Log::LogPath", "")
	//
	//level, _ := web.AppConfig.Int("Log::LogLevel")
	//logConf["level"] = level
	//
	//maxdays, lerr := web.AppConfig.Int64("Log::MaxDays")
	//if lerr != nil {
	//	maxdays = 10
	//}
	//logConf["maxdays"] = maxdays
	//
	//color, lerr := web.AppConfig.Bool("Log::Color")
	//if lerr != nil {
	//	color = true
	//}
	//logConf["color"] = color
	//
	//daily, lerr := web.AppConfig.Bool("Log::Daily")
	//if lerr != nil {
	//	daily = true
	//}
	//logConf["daily"] = daily
	//
	//confStr, err := json.Marshal(logConf)
	//if err != nil {
	//	fmt.Println("marshal failed,err:", err)
	//	return
	//}
	//adapter := web.AppConfig.DefaultString("Log::LogAdapter", "console")
	////err1 := logs.SetLogger(adapter, string(confStr))
	//err1 := logs.SetLogger(adapter, string(confStr))
	//if err1 != nil {
	//}
	//logs.SetLogFuncCall(true)

}

func ColorPrint(s string, i int) { //设置终端字体颜色 i 取值256 前景色和后景色共16*16
	//kernel32 := syscall.NewLazyDLL("kernel32.dll")
	//proc := kernel32.NewProc("SetConsoleTextAttribute")
	//handle, _, _ := proc.Call(uintptr(syscall.Stdout), uintptr(i))
	//fmt.Print(s)
	//handle, _, _ = proc.Call(uintptr(syscall.Stdout), uintptr(7))
	//CloseHandle := kernel32.NewProc("CloseHandle")
	//CloseHandle.Call(handle)
}

func ColorPrintStart(i int) { //设置终端字体颜色
	//kernel32 := syscall.NewLazyDLL("kernel32.dll")
	//proc := kernel32.NewProc("SetConsoleTextAttribute")
	//proc.Call(uintptr(syscall.Stdout), uintptr(i))
}
func ColorPrintEnd() { //设置终端字体颜色
	//kernel32 := syscall.NewLazyDLL("kernel32.dll")
	//proc := kernel32.NewProc("SetConsoleTextAttribute")
	//handle, _, _ := proc.Call(uintptr(syscall.Stdout), uintptr(7))
	//CloseHandle := kernel32.NewProc("CloseHandle")
	//CloseHandle.Call(handle)
}

func ShowColor() {
	//for i := 0; i < 16; i++ {
	//	for n := 0; n < 16; n++ {
	//		ColorPrint(fmt.Sprintf("%d", i*16+n), i*16+n)
	//	}
	//}
}
